package com.zsh.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author zsh
 * @Description
 * @create 2022-01-20 17:02
 */

@Controller
//@RequestMapping("/hello")
public class RequestMappingController {

    @RequestMapping(value = "/testRequest",method = RequestMethod.GET)
    public String success(){

        return "success";
    }

    @RequestMapping(value = "/testParamsAndHeaders",params = {"username"})
    public String testParamsAndHeaders(){
        return "success";
    }

    @RequestMapping("/a?a/testAnt")
    public String testAnt(){
        return "success";
    }

    @RequestMapping("/testPath/{id}/{username}")
    public String testPath(@PathVariable("id") String id,@PathVariable("username") String username){
        System.out.println(id + "->" + username);
        return "success";
    }
}
